package com.hdax.dm.rabbitMQ;

import com.hdax.dm.entity.scheduler.SchedulerSeat;
import com.hdax.dm.feign.scheduler.SchedulerSeatFeign;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@RabbitListener(queues = {"dm_scheduler_seat_rollback"})
public class SchedulerSeatRollBack {

    @Autowired
    private SchedulerSeatFeign schedulerSeatFeign;

    @RabbitHandler
    public void SchedulerSeatRollBack(SchedulerSeat schedulerSeat){
        schedulerSeatFeign.updateSeatStatus(schedulerSeat);
        System.out.println("座位状态被回滚了----------------------------");
    }

}
